package com.itany.shop.service;

import com.itany.shop.entity.User;
import com.itany.shop.exception.*;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public interface UserService {

    /**
     * 用户注册
     *
     * @param username 用户名,不能重复
     * @param password 密码
     * @param phone    电话
     * @param address  地址
     */
    void register(String username, String password, String phone, String address) throws RequestParameterErrorException, UserExistException;

    /*
     * 用户登录方法
     * @param username用户名
     * @param password 密码
     * */
    User login(String username, String password) throws RequestParameterErrorException, ObjectNotFoundException;

    User login(String username, String password, String code, String image) throws RequestParameterErrorException, ObjectNotFoundException, CodeErrorException, UsernameNotExistException;
    /**
     * 修改当前用户的密码
     *
     * @param userId
     * @param oldPassword
     * @param newPassword
     * @throws RequestParameterErrorException
     * @throws PasswordErrorException
     */
    void updatePassword(Integer userId, String oldPassword, String newPassword) throws RequestParameterErrorException, PasswordErrorException;
}